#ifndef APICLIENT_H
#define APICLIENT_H

#include <QObject>
#include <QDebug>
#include <map>
#include <map>

struct									clientInfo
{
	QString								_name;
	bool								_avaible;
	bool								_connected;

	clientInfo(QString name, bool avaible):
		_name(name), _avaible(avaible), _connected(false){}
	clientInfo():
		_name(QString()), _avaible(false), _connected(false){}
};

class apiClient : public QObject
{
	Q_OBJECT

public:
	apiClient(QObject *parent = 0);
	~apiClient();

public:
	void								addClient(quint16 id);
	clientInfo &						getClient(quint16 id);
	void								removeClient(quint16 id);
	std::list<quint16>					getAvaibles() const;

	void								setName(QString& name, quint16 id);
	void								setAvaible(bool avaible, quint16 id);
	void								setConnected(bool connect, quint16 id);

private:
	std::map<quint16, clientInfo *>		_clients;
	std::list<quint16>					_avaibles;
	bool								_active;

signals:
	void								recordMod(bool);
};

#endif // APICLIENT_H
